\(\int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx\) [695]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 183 \[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=-\frac {a \left (3 b^2-a^2 (1-m)\right ) (d \cos (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {3}{2},-\tan ^2(e+f x)\right ) \sec ^2(e+f x)^{m/2} \tan (e+f x)}{f (1-m)}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))^2}{f (2-m)}+\frac {b (d \cos (e+f x))^m \left (2 \left (b^2-a^2 (3-m)\right ) (1-m)+a b (4-m) m \tan (e+f x)\right )}{f m \left (2-3 m+m^2\right )} \]

[Out]

-a*(3*b^2-a^2*(1-m))*(d*cos(f*x+e))^m*hypergeom([1/2, 1+1/2*m],[3/2],-tan(f*x+e)^2)*(sec(f*x+e)^2)^(1/2*m)*tan
(f*x+e)/f/(1-m)+b*(d*cos(f*x+e))^m*(a+b*tan(f*x+e))^2/f/(2-m)+b*(d*cos(f*x+e))^m*(2*(b^2-a^2*(3-m))*(1-m)+a*b*
(4-m)*m*tan(f*x+e))/f/(1-m)/(2-m)/m

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 175, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3596, 3593, 757, 794, 251} \[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\frac {a \left (a^2-\frac {3 b^2}{1-m}\right ) \tan (e+f x) \sec ^2(e+f x)^{m/2} (d \cos (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m+2}{2},\frac {3}{2},-\tan ^2(e+f x)\right )}{f}+\frac {b (d \cos (e+f x))^m \left (2 (1-m) \left (b^2-a^2 (3-m)\right )+a b (4-m) m \tan (e+f x)\right )}{f m \left (m^2-3 m+2\right )}+\frac {b (a+b \tan (e+f x))^2 (d \cos (e+f x))^m}{f (2-m)} \]

[In]

Int[(d*Cos[e + f*x])^m*(a + b*Tan[e + f*x])^3,x]

[Out]

(a*(a^2 - (3*b^2)/(1 - m))*(d*Cos[e + f*x])^m*Hypergeometric2F1[1/2, (2 + m)/2, 3/2, -Tan[e + f*x]^2]*(Sec[e +
 f*x]^2)^(m/2)*Tan[e + f*x])/f + (b*(d*Cos[e + f*x])^m*(a + b*Tan[e + f*x])^2)/(f*(2 - m)) + (b*(d*Cos[e + f*x
])^m*(2*(b^2 - a^2*(3 - m))*(1 - m) + a*b*(4 - m)*m*Tan[e + f*x]))/(f*m*(2 - 3*m + m^2))

Rule 251

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F1[-p, 1/n, 1/n + 1, (-b)*(x^n/a)],
x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p
] || GtQ[a, 0])

Rule 757

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*((a + c*x^2)^(p
 + 1)/(c*(m + 2*p + 1))), x] + Dist[1/(c*(m + 2*p + 1)), Int[(d + e*x)^(m - 2)*Simp[c*d^2*(m + 2*p + 1) - a*e^
2*(m - 1) + 2*c*d*e*(m + p)*x, x]*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m, p}, x] && NeQ[c*d^2 + a*e^2,
0] && If[RationalQ[m], GtQ[m, 1], SumSimplerQ[m, -2]] && NeQ[m + 2*p + 1, 0] && IntQuadraticQ[a, 0, c, d, e, m
, p, x]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 3593

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[d^(2*
IntPart[m/2])*((d*Sec[e + f*x])^(2*FracPart[m/2])/(b*f*(Sec[e + f*x]^2)^FracPart[m/2])), Subst[Int[(a + x)^n*(
1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&
 !IntegerQ[m/2]

Rule 3596

Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(d*Co
s[e + f*x])^m*(d*Sec[e + f*x])^m, Int[(a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e,
f, m, n}, x] &&  !IntegerQ[m]

Rubi steps \begin{align*} \text {integral}& = \left ((d \cos (e+f x))^m (d \sec (e+f x))^m\right ) \int (d \sec (e+f x))^{-m} (a+b \tan (e+f x))^3 \, dx \\ & = \frac {\left ((d \cos (e+f x))^m \sec ^2(e+f x)^{m/2}\right ) \text {Subst}\left (\int (a+x)^3 \left (1+\frac {x^2}{b^2}\right )^{-1-\frac {m}{2}} \, dx,x,b \tan (e+f x)\right )}{b f} \\ & = \frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))^2}{f (2-m)}+\frac {\left (b (d \cos (e+f x))^m \sec ^2(e+f x)^{m/2}\right ) \text {Subst}\left (\int (a+x) \left (-2+\frac {a^2 (2-m)}{b^2}+\frac {a (4-m) x}{b^2}\right ) \left (1+\frac {x^2}{b^2}\right )^{-1-\frac {m}{2}} \, dx,x,b \tan (e+f x)\right )}{f (2-m)} \\ & = \frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))^2}{f (2-m)}+\frac {b (d \cos (e+f x))^m \left (2 \left (b^2-a^2 (3-m)\right ) (1-m)+a b (4-m) m \tan (e+f x)\right )}{f m \left (2-3 m+m^2\right )}-\frac {\left (a \left (3 b^2-a^2 (1-m)\right ) (d \cos (e+f x))^m \sec ^2(e+f x)^{m/2}\right ) \text {Subst}\left (\int \left (1+\frac {x^2}{b^2}\right )^{-1-\frac {m}{2}} \, dx,x,b \tan (e+f x)\right )}{b f (1-m)} \\ & = -\frac {a \left (3 b^2-a^2 (1-m)\right ) (d \cos (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {3}{2},-\tan ^2(e+f x)\right ) \sec ^2(e+f x)^{m/2} \tan (e+f x)}{f (1-m)}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))^2}{f (2-m)}+\frac {b (d \cos (e+f x))^m \left (2 \left (b^2-a^2 (3-m)\right ) (1-m)+a b (4-m) m \tan (e+f x)\right )}{f m \left (2-3 m+m^2\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.57 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.16 \[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\frac {\cos (e+f x) (d \cos (e+f x))^m \left (-\frac {b^3}{-2+m}+\frac {b \left (-3 a^2+b^2\right ) \cos ^2(e+f x)}{m}-\frac {a \left (a^2-3 b^2\right ) \cos ^3(e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+m}{2},\frac {3+m}{2},\cos ^2(e+f x)\right ) \sin (e+f x)}{(1+m) \sqrt {\sin ^2(e+f x)}}-\frac {3 a b^2 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+m),\frac {1+m}{2},\cos ^2(e+f x)\right ) \sin (2 (e+f x))}{2 (-1+m) \sqrt {\sin ^2(e+f x)}}\right ) (a+b \tan (e+f x))^3}{f (a \cos (e+f x)+b \sin (e+f x))^3} \]

[In]

Integrate[(d*Cos[e + f*x])^m*(a + b*Tan[e + f*x])^3,x]

[Out]

(Cos[e + f*x]*(d*Cos[e + f*x])^m*(-(b^3/(-2 + m)) + (b*(-3*a^2 + b^2)*Cos[e + f*x]^2)/m - (a*(a^2 - 3*b^2)*Cos
[e + f*x]^3*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/((1 + m)*Sqrt[Sin[e + f
*x]^2]) - (3*a*b^2*Hypergeometric2F1[1/2, (-1 + m)/2, (1 + m)/2, Cos[e + f*x]^2]*Sin[2*(e + f*x)])/(2*(-1 + m)
*Sqrt[Sin[e + f*x]^2]))*(a + b*Tan[e + f*x])^3)/(f*(a*Cos[e + f*x] + b*Sin[e + f*x])^3)

Maple [F]

\[\int \left (d \cos \left (f x +e \right )\right )^{m} \left (a +b \tan \left (f x +e \right )\right )^{3}d x\]

[In]

int((d*cos(f*x+e))^m*(a+b*tan(f*x+e))^3,x)

[Out]

int((d*cos(f*x+e))^m*(a+b*tan(f*x+e))^3,x)

Fricas [F]

\[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*cos(f*x+e))^m*(a+b*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

integral((b^3*tan(f*x + e)^3 + 3*a*b^2*tan(f*x + e)^2 + 3*a^2*b*tan(f*x + e) + a^3)*(d*cos(f*x + e))^m, x)

Sympy [F]

\[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\int \left (d \cos {\left (e + f x \right )}\right )^{m} \left (a + b \tan {\left (e + f x \right )}\right )^{3}\, dx \]

[In]

integrate((d*cos(f*x+e))**m*(a+b*tan(f*x+e))**3,x)

[Out]

Integral((d*cos(e + f*x))**m*(a + b*tan(e + f*x))**3, x)

Maxima [F]

\[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*cos(f*x+e))^m*(a+b*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e) + a)^3*(d*cos(f*x + e))^m, x)

Giac [F]

\[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*cos(f*x+e))^m*(a+b*tan(f*x+e))^3,x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)^3*(d*cos(f*x + e))^m, x)

Mupad [F(-1)]

Timed out. \[ \int (d \cos (e+f x))^m (a+b \tan (e+f x))^3 \, dx=\int {\left (d\,\cos \left (e+f\,x\right )\right )}^m\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^3 \,d x \]

[In]

int((d*cos(e + f*x))^m*(a + b*tan(e + f*x))^3,x)

[Out]

int((d*cos(e + f*x))^m*(a + b*tan(e + f*x))^3, x)